package com.yan.job;

import com.yan.domainjob.American;
import com.yan.domainjob.Chinese;
import com.yan.domainjob.Indian;
import com.yan.domainjob.Person1;

public class Test3 {
    public static void main(String[] args) {
        Person1[] people = new Person1[3];
        Chinese chinese = new Chinese();
        people[0] = chinese;
        American american = new American();
        people[1] = american;
        Indian indian = new Indian();
        people[2] = indian;
        for (int i = 0; i < people.length; i++) {
            people[i].eat();
        }
    }
}
